#include "VxIrrLib.h"

//------------------------------------------------------------------------------
//=== constructor ===//
EntAsteroidBlue::EntAsteroidBlue( VxIrrBase *	poIrrBase, const EntSpawnData& oEntSpawnData )
	: EntBase( poIrrBase )
	, m_poRotAnimator(0)
{
	SetEntType( eEntityTypeAsteroidBlue );
	CreateEntity( oEntSpawnData );
}

//------------------------------------------------------------------------------
//=== methods ===//
//------------------------------------------------------------------------------
//! override EntBase
//! hande collision with another object
//! return non zero if caller should not process any more contact points
RCODE  EntAsteroidBlue::HandleCollision( EntBase * poOtherEntity, const btPersistentManifold * poContactManifold, float f32NormalScale )
{
	switch( poOtherEntity->m_eEntType )
	{
	case eEntityTypeCometFire:
		log_msg( 0, "Collision Asteroid <-> Comet Fire\n" );
		break;
	case eEntityTypeCometIce:
		log_msg( 0, "Collision Asteroid <-> Comet Ice\n" );
		break;
	case eEntityTypeAsteroidRed:
		log_msg( 0, "Collision Asteroid Red <-> Asteroid\n" );
		break;
	case eEntityTypeAsteroidBlue:
		log_msg( 0, "Collision Asteroid Blue <-> Asteroid\n" );
		break;
	case eEntityTypeEarth:
		log_msg( 0, "Collision Asteroid <-> Earth\n" );
		break;
	default:
		log_msg( 0, "Collision Comet Ice <-> UNKOWN\n" );
		break;
	}
	return 0;
}
//------------------------------------------------------------------------------
//! called once per second
void EntAsteroidBlue::OncePerSecond( void )
{
	if( this->GetPowerLevel() > 0 )
	{
		vx_assert( this->m_s32PowerUpTTL )
		this->m_s32PowerUpTTL--;
		if( 0 == this->m_s32PowerUpTTL )
		{
			m_s32PowerLevel = 0;
			OnPowerLevelDown();
		}
	}
}
//------------------------------------------------------------------------------
//! handle changes when power level goes up
void EntAsteroidBlue::OnPowerLevelUp( S32 s32PowerLevel, S32 s32PowerUpTTL )
{
	m_s32PowerLevel = s32PowerLevel;
	this->m_s32PowerUpTTL = s32PowerUpTTL;


}
//------------------------------------------------------------------------------
//! handle changes when power level goes down
void EntAsteroidBlue::OnPowerLevelDown( void )
{

}


